﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using ProjectVLIB_LAB02;

namespace BT1
{
    public partial class frmLogin : Form
    {
        public frmLogin()
        {
            InitializeComponent();
        }

        //Event
        private void formNew_FormClosed(object sender, FormClosedEventArgs e)
        {
            this.Show();
        }

        private void btnConfig_Click(object sender, EventArgs e)
        {
                frmConnConfig formNew = new frmConnConfig();
                formNew.FormClosed += new FormClosedEventHandler(formNew_FormClosed);
                formNew.Show();
                this.Hide();
           
       }

        private void btnLogin_Click(object sender, EventArgs e)
        {
            if (txtUserName.Text.Equals("admin") && txtPassword.Text.Equals("admin"))
            {
                frmMain formNew = new frmMain();
                formNew.FormClosed += new FormClosedEventHandler(formNew_FormClosed);
                formNew.Show();
                this.Hide();
            }
            else
                MessageBox.Show("Vui lòng nhập lại tên đăng nhập và mật khẩu");
        }

        private void btnExit_Click(object sender, EventArgs e)
        {
            this.Close();
            
        }

        private void frmLogin_Load(object sender, EventArgs e)
        {
            SanPham.Text = "VIDEO-LIB";
            PhienBan.Text = "v1.0";
        }
    }
}
